
package com.hitechbangla.fctu.form;

import fctu.simulator.HTB_MAIN;

/**
 *
 * @author Sultan
 */
public class SelectIFFInfo extends javax.swing.JFrame {

    private HTB_MAIN htb_main;
      
    public SelectIFFInfo(HTB_MAIN htb_main) 
    {
        this.setTitle("IFF Information");
        initComponents();
        
        this.htb_main = htb_main;
        
       /* if(htb_main.radarACInfoSelection.isMode1())
	{
            chkbox_Mode1.setSelected(true);
	   // jCheckBoxCallSign.setSelected(true);
	}
	
	if(htb_main.radarACInfoSelection.isMode2())
	{
            chkbox_Mode2.setSelected(true);
	   // jCheckBoxSpeed.setSelected(true);
	}
        if(htb_main.radarACInfoSelection.isMode3A())
	{
            chkbox_Mode3A.setSelected(true);
	   // jCheckBoxSpeed.setSelected(true);
	}
	if(htb_main.radarACInfoSelection.isModeC())
	{
            chkbox_ModeC.setSelected(true);
	   // jCheckBoxSpeed.setSelected(true);
	}
        
	if(htb_main.radarACInfoSelection.isAltimeter())
	{
            chkbox_Altimeter.setSelected(true);
	    //jCheckBoxHeading.setSelected(true);
	}
	
	if(htb_main.radarACInfoSelection.isFuelStatus())
	{
            chkbox_FuelStatus.setSelected(true);
	    //jCheckBoxHeight.setSelected(true);
	}
        if(htb_main.radarACInfoSelection.isLocation())
	{
            chkbox_Location.setSelected(true);
	   // jCheckBoxSpeed.setSelected(true);
	}*/
    }

  
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        chkbox_Mode1 = new javax.swing.JCheckBox();
        chkbox_Mode3A = new javax.swing.JCheckBox();
        chkbox_Mode2 = new javax.swing.JCheckBox();
        chkbox_ModeC = new javax.swing.JCheckBox();
        chkbox_Altimeter = new javax.swing.JCheckBox();
        chkbox_WeaponStatus = new javax.swing.JCheckBox();
        chkbox_Location = new javax.swing.JCheckBox();
        chkbox_FuelStatus = new javax.swing.JCheckBox();
        jButton_OK = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        chkbox_Mode1.setText("Mode 1");

        chkbox_Mode3A.setText("Mode 3A");

        chkbox_Mode2.setText("Mode 2");

        chkbox_ModeC.setText("Mode C");

        chkbox_Altimeter.setText("Altimeter");

        chkbox_WeaponStatus.setText("Weapon Status");

        chkbox_Location.setText("Location");

        chkbox_FuelStatus.setText("Fuel Status");

        jButton_OK.setText("OK");
        jButton_OK.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_OKActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(59, 59, 59)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(chkbox_FuelStatus)
                    .addComponent(chkbox_Mode2)
                    .addComponent(chkbox_Mode3A)
                    .addComponent(chkbox_ModeC)
                    .addComponent(chkbox_Altimeter)
                    .addComponent(chkbox_WeaponStatus)
                    .addComponent(chkbox_Location)
                    .addComponent(chkbox_Mode1)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(14, 14, 14)
                        .addComponent(jButton_OK)))
                .addContainerGap(54, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(26, 26, 26)
                .addComponent(chkbox_Mode1)
                .addGap(18, 18, 18)
                .addComponent(chkbox_Mode2)
                .addGap(18, 18, 18)
                .addComponent(chkbox_Mode3A)
                .addGap(18, 18, 18)
                .addComponent(chkbox_ModeC)
                .addGap(18, 18, 18)
                .addComponent(chkbox_Altimeter)
                .addGap(18, 18, 18)
                .addComponent(chkbox_WeaponStatus)
                .addGap(18, 18, 18)
                .addComponent(chkbox_FuelStatus)
                .addGap(18, 18, 18)
                .addComponent(chkbox_Location)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 24, Short.MAX_VALUE)
                .addComponent(jButton_OK)
                .addGap(11, 11, 11))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButton_OKActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_OKActionPerformed
        
	HTB_MAIN.iFFOptionSelection.setMode1(chkbox_Mode1.isSelected());
	HTB_MAIN.iFFOptionSelection.setMode2(chkbox_Mode2.isSelected());
	HTB_MAIN.iFFOptionSelection.setMode3A(chkbox_Mode3A.isSelected());
	HTB_MAIN.iFFOptionSelection.setModeC(chkbox_ModeC.isSelected());
	HTB_MAIN.iFFOptionSelection.setAltimeter(chkbox_Altimeter.isSelected());
	HTB_MAIN.iFFOptionSelection.setFuelStatus(chkbox_FuelStatus.isSelected());
	HTB_MAIN.iFFOptionSelection.setLocation(chkbox_Location.isSelected());
        
	if(chkbox_Mode1.isSelected() || chkbox_Mode2.isSelected() || chkbox_Mode3A.isSelected() || chkbox_ModeC.isSelected() || chkbox_Altimeter.isSelected() || chkbox_FuelStatus.isSelected() || chkbox_Location.isSelected())
	{
	    HTB_MAIN.radarACInfoSelection.unSelectAll();
	}
	
        this.setVisible(false);
	this.dispose();
    }//GEN-LAST:event_jButton_OKActionPerformed

   
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(SelectIFFInfo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(SelectIFFInfo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(SelectIFFInfo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(SelectIFFInfo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new SelectIFFInfo(null).setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JCheckBox chkbox_Altimeter;
    private javax.swing.JCheckBox chkbox_FuelStatus;
    private javax.swing.JCheckBox chkbox_Location;
    private javax.swing.JCheckBox chkbox_Mode1;
    private javax.swing.JCheckBox chkbox_Mode2;
    private javax.swing.JCheckBox chkbox_Mode3A;
    private javax.swing.JCheckBox chkbox_ModeC;
    private javax.swing.JCheckBox chkbox_WeaponStatus;
    private javax.swing.JButton jButton_OK;
    // End of variables declaration//GEN-END:variables
}
